<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <canvas id="canvas" width="600" height="800" style="border: 1px solid gray"></canvas>
</body>
</html>
<script>

    let cns = document.querySelector('#canvas');
    let context = cns.getContext('2d');
    
    for (let i = 0; i < 6; i++) {
        
        for (let j = 0; j < 6; j++) {
            context.fillStyle=`rgb(${255-i*42.5},${255-j*42.5},0)`;
            context.fillRect(j*50, i*50, 50, 50);
        }
        
    }


</script>